|
| Contents | |
| Introduction |
It is now possible to customize the prompts that pop up as a result of the user not having the Beatnik Player installed, so that they appear in a language appropriate to the Web content you are sonifying. This applies also to the prompts that appear when the sonified content requires a version of the Beatnik Player higher than the Player that is installed on the user's system, and also the prompt that appears for Netscape Navigator users who have Java disabled.
By default, all Music Object compatibility prompts are displayed in US English. Language modules are optional JavaScript files that can override the default English language.
Using a Music Object language module is easy. Language modules are simply JavaScript files, like the "music-object.js" file, that can be sourced into sonified pages as needed. A language module that is sourced in after the "music-object.js" file will slot into the Music Object API and alter the compatibility prompt boxes that appear so that they are in the language desired for the Web site.
In the following example, the Portuguese language module is being used...
<HTML><TITLE>Page Using the Portuguese Language Module</TITLE></HTML>
<BODY>
<SCRIPT SRC="music-object.js"></SCRIPT>
<SCRIPT SRC="music-object-l-portuguese.js"></SCRIPT>
<SCRIPT LANGUAGE=JavaScript><!-- //
// ***************************
// SOME SONIFICATION SCRIPTING
// ***************************
// --></SCRIPT>
<!-- ****************** -->
<!-- SOME SONIFIED HTML -->
<!-- ****************** -->
</BODY></HTML>
|
IMPORTANT : It is only possible to use one language module in a Web page. If you source in multiple language modules, the last one to be sourced in will override all the previously sourced in language modules. You should use the language module appropriate to the language you are using on your Web pages. The language module you use should be sourced in after the "music-object.js" file, otherwise it will not work correctly.
| What Language Modules are Available ? |
The following Music Object language modules are currently available, with more to follow...
To get any of the above language modules' JavaScript file, simply right-click (click-and-hold for Mac users) on the language module link in the list above. Then, from the menu that pops up, select the 'Save Link As...' or 'Save Target As...' option and save the JavaScript file into an appropriate folder of the local copy of your Web site.
In case you have problems saving the file using the above links, the language module JavaScript files can also be found inside the documentation's "javascript" folder, along with the "music-object.js" file.
If you are fluent in the English language and are also fluent in another language for which there is currently no language module listed above, then you would be helping out the Beatnik cause tremendously if you could offer your translation services and provide us with a language module that can be made available in this documentation and shared with all other Beatnik developers. For more information, see the section Creating Your Own Language Modules.
| Building a Language Module Into a Suite |
If you find yourself regularly using a particular language module in all your sonified Web pages, then you may wish to consider building a Music Object suite to simplify your authoring and to make your life a little easier. For more information, consult the section Making a Custom Music Object Suite
| Creating Your Own Language Modules |
If you are working on a Web site that is in a language not supported by one of the currently available Music Object language modules and you are fluent in both English and the language required for the site, then you can use the U.S. English language module below as a template to make a custom language module for your site. Of course, you would also be helping out many other Beatnik content developers if you shared the new language module with the Beatnik developer community.
| |
/**************************************** Music Object Language Module - U.S. English - Version 1.0.0 written by Chris van Rensburg REQUIRES: - music-object.js (3.2.0 or higher) © Copyright 1996-1999 Beatnik, Inc. All Rights Reserved ***************************************/ function mo_upgradePrompt () { mo_promptUser ( 'Please Upgrade Beatnik', 'This page has been optimized for the features of version <B>' + Music.requiredMinVersion + ' (or higher)</B> of the Beatnik Player. ' + 'The currently installed version in your browser is ' + Music.playerVersion + '.<P>If you choose to IGNORE this message, the page will continue ' + 'to load normally, but may not function properly as designed by the author.', 'UPGRADE BEATNIK >>>','mo_installPlayer ()', 'IGNORE','mo_promptClose ()' ); } function mo_installPrompt () { mo_promptUser ( 'Beatnik Enhanced Content !!', 'This page has been optimized for the audio features of the ' + '<B>Beatnik Player</B>. It appears you do not have ' + 'the Beatnik Player installed.<P>If you choose to IGNORE this message, ' + 'the page will continue to load normally, except there will be no Beatnik audio.', 'INSTALL BEATNIK >>>','mo_installPlayer ()', 'IGNORE','mo_promptClose ()' ); } function mo_enableJavaPrompt () { mo_promptUser ( 'Please Enable Java', 'This page makes use of the interactive audio features of the ' + 'Beatnik Player. Java is currently not enabled in your browser. ' + 'In order for the page to function correctly with Beatnik, ' + '<B>you must have Java enabled</B>.<P>This page will continue to load normally, ' + 'but some interactive audio functionality may be absent.', ' OK ','mo_promptClose ()' ); } Music.upgradePlayerText = 'Upgrade Beatnik'; Music.getPlayerText = 'Get Beatnik'; |
To edit the template, you can either copy-and-paste the source code shown above, or you can obtain the "music-object-l-english-us.js" JavaScript file from the documentation's "javascript" folder.
In the template source code listing above, the text that is highlighted represents the text you will need to replace to create your custom language module. This includes the text that needs to be translated into the desired language, as well as the language module name and author (in the comments section at the top of the module). In some languages the grammatical structure may be sufficiently different that lines may have to be pushed around in the course of doing the translation, but you should try to retain the original formatting (such as bolding and paragraph breaks) as much as possible.
Once you have created your custom language module, you should save it into an appropriate folder of the local copy of your Web site, with a filename of the form "music-object-l-mylanguage.js". An example would be "music-object-l-dutch.js" for a Dutch language module. Once you've saved your custom language module, you should create a test page as follows...
| |
<HTML><HEAD><TITLE>Custom Language Module Test Page</TITLE></HEAD>
<BODY>
<SCRIPT SRC="music-object.js"></SCRIPT>
<SCRIPT SRC="music-object-l-mylanguage.js"></SCRIPT>
<A HREF="javascript://" ONCLICK="mo_upgradePrompt (); return false">
Show the Upgrade Prompt
</A>
<P>
<A HREF="javascript://" ONCLICK="mo_installPrompt (); return false">
Show the Install Prompt
</A>
<P>
<A HREF="javascript://" ONCLICK="mo_enableJavaPrompt (); return false">
Show the Enable Java Prompt
</A>
<P>
</BODY></HTML>
|
To create your test page, follow these simple steps...